
class X{
    Y y = new Y();
    {}
    //构造方法
    public X(){
        System.out.print("X");
    }

}

class Y{
    //构造方法
    public Y(){
        System.out.print("Y");
    }
}

public class Z extends X{
    Y y = new Y();
    public Z(){
        super();
        System.out.print("Z");
    }

    public static void main(String[] args) {
        new Z();
    }
}
